package com.sms.shared;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
@Entity
@Table(name="site")
public class Site implements Serializable{
	@Id
	@GenericGenerator(name = "generator", strategy = "increment")
    @GeneratedValue(generator = "generator")
	@Column(name = "Id")
	private Long id;
	
	@Column(name = "location", nullable = false, length = 100)
	private String location;
	
	@Column(name = "capacity", nullable = false, length = 20)
	private String capacity;

	@Column(name = "name", nullable = false, length = 30)
	private String name;

	@Column(name = "mapAddress", nullable = true, length = 100)
	private String mapAddress;
	
	@Column(name = "createdDate")
	private java.util.Date createdDate;
	
	@Column(name = "updatedDate")
	private java.util.Date updatedDate;
	
	@Column(name = "installedDate")
	private java.util.Date installedDate;
	
	@Column(name = "latitude")
	private java.lang.Double latitude;
	
	@Column(name = "longitude")
	private java.lang.Double longitude;
	
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name = "invertorTypeId", insertable = false, updatable = false)
	private InvertorType invertorType;
	
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name = "parsingMethodId", insertable = false, updatable = false)
	private ParsingMethod parsingMethod;
	
	@OneToMany(cascade = CascadeType.ALL,fetch=FetchType.LAZY)
	@JoinColumn(name = "siteId")
	private Set<Equipment> equipments = new HashSet<Equipment>();

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getLocation() {
		return location;
	}

	public void setLocation(String location) {
		this.location = location;
	}

	public String getCapacity() {
		return capacity;
	}

	public void setCapacity(String capacity) {
		this.capacity = capacity;
	}

	public java.util.Date getCreatedDate() {
		return createdDate;
	}

	public void setCreatedDate(java.util.Date createdDate) {
		this.createdDate = createdDate;
	}

	public java.util.Date getUpdatedDate() {
		return updatedDate;
	}

	public void setUpdatedDate(java.util.Date updatedDate) {
		this.updatedDate = updatedDate;
	}

	public java.util.Date getInstalledDate() {
		return installedDate;
	}

	public void setInstalledDate(java.util.Date installedDate) {
		this.installedDate = installedDate;
	}

	public Set<Equipment> getEquipments() {
		return equipments;
	}

	public void setEquipments(Set<Equipment> equipments) {
		this.equipments = equipments;
	}

	public java.lang.Double getLatitude() {
		return latitude;
	}

	public void setLatitude(java.lang.Double latitude) {
		this.latitude = latitude;
	}

	public java.lang.Double getLongitude() {
		return longitude;
	}

	public void setLongitude(java.lang.Double longitude) {
		this.longitude = longitude;
	}

	public InvertorType getInvertorType() {
		return invertorType;
	}

	public void setInvertorType(InvertorType invertorType) {
		this.invertorType = invertorType;
	}

	public ParsingMethod getParsingMethod() {
		return parsingMethod;
	}

	public void setParsingMethod(ParsingMethod parsingMethod) {
		this.parsingMethod = parsingMethod;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getMapAddress() {
		return mapAddress;
	}

	public void setMapAddress(String mapAddress) {
		this.mapAddress = mapAddress;
	}
	

}
